package com.sg.service.base.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.dto.base.app.req.*;
import com.sg.entity.OmsBizAppStatusCheckItem;
import com.sg.service.base.app.MOmsBizAppStatusCheckItemService;
import com.wicket.okrapp.common.annotations.BanAuto;
import com.wicket.okrapp.common.dto.FieldInfo;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrapp.dal.mapper.mbg.OmsBizAppStatusCheckItemMapper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsBizAppStatusCheckItemServiceImpl
        extends ServiceImpl<OmsBizAppStatusCheckItemMapper, OmsBizAppStatusCheckItem>
        implements MOmsBizAppStatusCheckItemService {

    @Autowired
    OmsBizAppStatusCheckItemMapper omsBizAppStatusCheckItemMapper;

    /**
     * 3-11-04新增业务应用校验项状态[2410]
     * gen by moon at 10/16/2022, 7:14:45 AM
     */
    @Trace(operationName = "3-11-04新增业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addBizAppCheckItemStat(OmsBizAppStatusCheckItem omsBizAppStatusCheckItem) {
        omsBizAppStatusCheckItem.setStatusCheckItemId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsBizAppStatusCheckItem.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsBizAppStatusCheckItem.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsBizAppStatusCheckItem.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsBizAppStatusCheckItem.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsBizAppStatusCheckItem)) {
            return omsBizAppStatusCheckItem.getStatusCheckItemId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-11-04查业务应用校验项状态详情[2661]
     * gen by moon at 3/30/2023, 12:39:13 PM
     */
    @Trace(operationName = "3-11-04查业务应用校验项状态详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsBizAppStatusCheckItem queryBizAppCheckItemStatDetail(QueryBizAppCheckItemStatDetailReq reqDto) {

        try {
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsBizAppStatusCheckItem> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsBizAppStatusCheckItem retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04修改业务应用校验项状态[2660]
     * gen by moon at 10/16/2022, 7:14:46 AM
     */
    @Trace(operationName = "3-11-04修改业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateBizAppCheckItemStat(OmsBizAppStatusCheckItem omsBizAppStatusCheckItem) {
        omsBizAppStatusCheckItem.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsBizAppStatusCheckItem);
    }

    /**
     * 3-11-04批量删业务应用校验项状态[2812]
     * gen by moon at 10/16/2022, 7:14:50 AM
     */
    @Trace(operationName = "3-11-04批量删业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteBizAppCheckItemStat(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * 3-11-04批量改业务应用校验项状态[2770]
     * gen by moon at 10/16/2022, 7:14:49 AM
     */
    @Trace(operationName = "3-11-04批量改业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateBizAppCheckItemStat(List<OmsBizAppStatusCheckItem> omsBizAppStatusCheckItem) {

        if (omsBizAppStatusCheckItem == null || omsBizAppStatusCheckItem.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsBizAppStatusCheckItem);

    }

    /**
     * 3-11-04批量查业务应用校验项状态[2769]
     * gen by moon at 10/16/2022, 7:14:48 AM
     */
    @Trace(operationName = "3-11-04批量查业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> batchQueryBizAppCheckItemStat(BatchQueryBizAppCheckItemStatReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getBizAppCheckItemStatList() == null || reqDto.getBizAppCheckItemStatList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getBizAppCheckItemStatList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04查业务应用校验项状态列表[2768]
     * gen by moon at 6/10/2023, 8:07:12 PM
     */
    @Trace(operationName = "3-11-04查业务应用校验项状态列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> queryBizAppCheckItemStatList(QueryBizAppCheckItemStatListReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByAsc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04批量增业务应用校验项状态[2960]
     * gen by moon at 10/16/2022, 7:14:51 AM
     */
    @Trace(operationName = "3-11-04批量增业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddBizAppCheckItemStat(List<OmsBizAppStatusCheckItem> omsBizAppStatusCheckItem) {

        if (omsBizAppStatusCheckItem == null || omsBizAppStatusCheckItem.size() == 0) {
            return false;
        }

        return super.saveBatch(omsBizAppStatusCheckItem.stream().map(item -> {
            item.setStatusCheckItemId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 3-11-04删除业务应用校验项状态[3369]
     * gen by moon at 10/16/2022, 7:14:51 AM
     */
    @Trace(operationName = "3-11-04删除业务应用校验项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteBizAppCheckItemStat(String statusCheckItemId) {

        return super.removeById(statusCheckItemId);
    }

    /**
     * 3-11-04批量查询业务应用校验项状态By主键ID[3734]
     * gen by moon at 10/16/2022, 7:14:52 AM
     */
    @Trace(operationName = "3-11-04批量查询业务应用校验项状态By主键ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> batchQueryBizAppCheckItemStatById(BatchQueryBizAppCheckItemStatByIdReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();

            if (reqDto.getBizAppCheckItemStatList() == null || reqDto.getBizAppCheckItemStatList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("status_check_item_id", reqDto.getBizAppCheckItemStatList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04查询业务应用校验项状态列表ByCodes[3894]
     * gen by moon at 12/17/2022, 5:29:34 AM
     */
    @Trace(operationName = "3-11-04查询业务应用校验项状态列表ByCodes")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> batchQueryBizAppCheckItemStatListByCodes(BatchQueryBizAppCheckItemStatListByCodesReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getCheckItemCodeList() == null || reqDto.getCheckItemCodeList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("check_item_code", reqDto.getCheckItemCodeList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04批量查询检查项状态[4083]
     * gen by moon at 10/16/2022, 7:14:54 AM
     */
    @Trace(operationName = "3-11-04批量查询检查项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> batchQueryCheckItemStat(BatchQueryCheckItemStatReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getBizAppCheckItemStatList() == null || reqDto.getBizAppCheckItemStatList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getBizAppCheckItemStatList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04查询单条检查项状态详情[4402]
     * gen by moon at 3/30/2023, 12:39:14 PM
     */
    @Trace(operationName = "3-11-04查询单条检查项状态详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsBizAppStatusCheckItem querySingleBizAppCheckItemDetail(QuerySingleBizAppCheckItemDetailReq reqDto) {

        try {

            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsBizAppStatusCheckItem> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsBizAppStatusCheckItem retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3-11-04一键删除检查项状态测试验证数据[4429]
     * gen by moon at 10/16/2022, 7:14:55 AM
     */
    @Trace(operationName = "M3-11-04一键删除检查项状态测试验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean autoDeleteStatusCheckItemTest(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M3-11-04查询检查项状态测试列表[4457]
     * gen by moon at 10/16/2022, 7:14:56 AM
     */
    @Trace(operationName = "M3-11-04查询检查项状态测试列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> queryStatusCheckItemTestList(QueryStatusCheckItemTestListReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3构造状态检查项验证数据[4483]
     * gen by moon at 10/16/2022, 7:14:57 AM
     */
    @Trace(operationName = "M3构造状态检查项验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String buildStatusCheckItem(OmsBizAppStatusCheckItem omsBizAppStatusCheckItem) {
        omsBizAppStatusCheckItem.setStatusCheckItemId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsBizAppStatusCheckItem.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsBizAppStatusCheckItem.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsBizAppStatusCheckItem.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsBizAppStatusCheckItem.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsBizAppStatusCheckItem)) {
            return omsBizAppStatusCheckItem.getStatusCheckItemId();
        } else {
            return "-1";
        }

    }

    /**
     * M3-修改单条检查项状态[4484]
     * gen by moon at 12/27/2022, 8:25:28 PM
     */
    @Trace(operationName = "M3-修改单条检查项状态")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateSingleBizAppCheckItem(OmsBizAppStatusCheckItem omsBizAppStatusCheckItem) {
        omsBizAppStatusCheckItem.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsBizAppStatusCheckItem.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsBizAppStatusCheckItem);
    }

    /**
     * M3-批量改检查项状态测试[5538]
     * gen by moon at 12/27/2022, 8:25:29 PM
     */
    @Trace(operationName = "M3-批量改检查项状态测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateStatusCheckItemTest(List<OmsBizAppStatusCheckItem> omsBizAppStatusCheckItem) {

        if (omsBizAppStatusCheckItem == null || omsBizAppStatusCheckItem.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsBizAppStatusCheckItem);

    }

    /**
     * M3-11-03批量查询检查项状态测试[5562]
     * gen by moon at 12/30/2022, 6:32:38 PM
     */
    @Trace(operationName = "M3-11-03批量查询检查项状态测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsBizAppStatusCheckItem> batchQueryStatusCheckItemTest(BatchQueryStatusCheckItemTestReq reqDto) {

        try {
            QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();

            if (reqDto.getCheckItemStatList() == null || reqDto.getCheckItemStatList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getCheckItemStatList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsBizAppStatusCheckItem.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsBizAppStatusCheckItem.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsBizAppStatusCheckItem>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-11-04执行业务应用检查项状态【悬停】[6215]
     * gen by moon at 4/3/2023, 11:12:52 AM
     */
    @Trace(operationName = "3-11-04执行业务应用检查项状态【悬停】")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public List<OmsBizAppStatusCheckItem> implementBizAppCheckItemStateHover(ImplementBizAppCheckItemStateHoverReq reqDto) {
        try {
            long count = 500;
            while (true) {
                if (count == 0) {
                    break;
                }
                QueryWrapper<OmsBizAppStatusCheckItem> queryWrapper = new QueryWrapper<>();
                Map<String, Object> fieldInfoMap = null;
                fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
                CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
                queryWrapper.orderByDesc("create_time");
                List<OmsBizAppStatusCheckItem> retList = super.list(queryWrapper);
                if (retList != null && retList.size() > 0) {
                    return retList;
                }
                count--;
                Thread.sleep(10);
            }
            throw new BizException("-1", false);
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }

    }

    /**
     * M3批量删检查项状态测试[9530]
     * gen by moon at 5/9/2024, 10:59:46 AM
     */
    @Trace(operationName = "M3批量删检查项状态测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteStatusCheckItemTest(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }
}
